package com.api.tournament.controller;
import com.api.core.controller.Ctrl;
import com.api.core.response.Result;
import com.api.core.response.ResultGenerator;
import com.api.tournament.model.Stage;
import com.api.tournament.service.StageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.List;
import com.api.core.annotation.PowerEnable;
import io.swagger.annotations.*;



/**
* Created by wanghuiwen on 2021/03/23.
*/
@PowerEnable(name = "赛事",url = "/stage")
@Api(value = "赛事", tags = {"赛事"})
@RestController
@RequestMapping("/stage")
public class StageController extends Ctrl{
    @Resource
    private StageService stageService;

    @ApiOperation(value = "开始阶段比赛", tags = {"赛事"}, notes = "开始阶段比赛")
    @PostMapping(value="/start",name="开始阶段比赛")
    public Result start(Long stageId) {
        return stageService.start(stageId);
    }

    @ApiOperation(value = "结束阶段比赛", tags = {"赛事"}, notes = "开始阶段比赛")
    @PostMapping(value="/stop",name="开始阶段比赛")
    public Result stop(Long stageId) {
        return stageService.stop(stageId);
    }




}
